<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:s="http://jboss.org/seam/faces"
                xmlns:p="http://http://java.sun.com/jsf/composite/components/property"
                template="/WEB-INF/layout/template.xhtml">

    <ui:define name="content">

        <div class="section">
            <h1>Change Your Password</h1>
        </div>

        <div class="section">

            <div class="errors">
                <h:messages id="messages" globalOnly="true"/>
            </div>

            <h:form id="pwdForm" prependId="false">

                <fieldset>

                    <p:input id="current" label="Current password">
                        <h:inputSecret id="input" value="#{currentUser.password}">
                            <f:validator validatorId="currentPassword"/>
                        </h:inputSecret>
                    </p:input>

                    <p:input id="new" label="New password">
                        <h:inputSecret id="input" value="#{currentUser.password}"/>
                    </p:input>

                    <p:input id="confirm" label="Confirm password">
                        <h:inputSecret id="input" value="#{passwordManager.confirmPassword}"/>
                    </p:input>

                    <div class="buttonBox">
                        <h:commandButton id="change" value="Change" action="#{passwordManager.changePassword}"/>
                        #{' '}
                        <h:button id="cancel" value="Cancel" outcome="/search.xhtml"/>
                    </div>
                </fieldset>
                <s:validateForm id="passwordCheck" validatorId="confirmPassword"
                                fields="password=new:input confirmPassword=confirm:input"/>
            </h:form>
        </div>

    </ui:define>

    <ui:define name="sidebar">
        <div class="content">
            <h1>Simple things should be easy</h1>

            <p>
                (And so should some complex things.) You shouldn't have to write four different classes just to change a
                password. Traditional J2EE architectures require that developers spend more time writing code to make the
                frameworks happy, than they ever get to spend writing code to make the user happy. Seam lets you reduce the
                size of your code dramatically. And that reduces bugs. And it makes refactoring easier. And it makes
                delivering new functionality quicker. Productivity matters. But with Seam, JSF, EJB 3.0 and jBPM, you don't
                need to sacrifice the ability to handle complex problems just to achieve great productivity.
            </p>
        </div>
    </ui:define>

</ui:composition>
